<?php

namespace app\common;

use think\Exception;

class Common
{
    /**
     * 后台管理员操作记录
     *
     * @param $request
     * @param string $logInfo
     */
    public static function agentLog($request, $logInfo){
        try {
            $data['userId'] = session('AGENT')['id'];
            $data['logInfo'] = $logInfo;
            $data['logIp'] = get_IP();
            $data['logUrl'] = $request->path();
            $data['logTime'] = time();

            $model = db('agentlog');
            $model->insert($data);
        } catch (Exception $e) {

        }
    }
}